<template>
  <div class="el-show-mine">
    <div class="el-show-container">
      <div class="el-show-item" v-for="(file,index) in fileList" :key="index">
        <img v-if="file.type == 0" class="el-show-set" :src="file.url" alt="">
        <img v-else class="el-show-set" :src="serSet" alt="">
        <span class="el-show-actions">
          <span class="el-item-preview" @click="onPreview(file)">
            <i class="el-icon-zoom-in"></i>
          </span>
        </span>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "el-show-mine",
    props: {
      fileList: {
        type: Array,
        default: []
      },
      onPreview: {
        type: Function
      }
    },
    data() {
      return {
        serSet: 'http://ossyd.chiq-cloud.com/dips/img/defaultVideoPicture.png'
      }
    },
    mounted() {

    },
    methods: {}
  }
</script>

<style scoped>
  .el-show-container{
    display: flex;
    flex-wrap: wrap;
  }
  .el-show-item{
    display: flex;
    position: relative;
    border: 1px solid #c0ccda;
    margin: 0 8px 8px 0;
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
    width: 148px;
    height: 148px;
  }
  .el-show-set{
    width: 100%;
    height: 100%;
  }
  .el-show-actions{
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: default;
    color: #fff;
    opacity: 0;
    background-color: rgba(0,0,0,.5);
    transition: opacity .3s;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .el-item-preview{
    display: none;
  }
  .el-show-actions:hover{
    opacity: 1;
  }
  .el-show-actions:hover .el-item-preview{
    display: flex;
  }
  .el-icon-zoom-in{
    cursor: pointer;
    font-size: 20px;
  }
</style>
